/* $(function(){
    $.get("http://jx.xuzhixiang.top/ap/api/login.php",{
        username:"ztt",
        password:123456,
     }).then((resData)=>{
        // window.location.href="index.html";
     });
}) */
$("#J_LoginButton").on("click",function(e){
    e.preventDefault();
    let username = $("#J_LoginUser").val();
    let password = $("#J_LoginPsw").val();
    if(username==""||password==""){
        alert("用户名或密码不能为空")
    }else{
        $.get("http://jx.xuzhixiang.top/ap/api/login.php",{
            username:username,
            password:password,
            
          }).then((resData)=>{
            sessionStorage.setItem("userinfo",JSON.stringify(resData));
            if(resData.code==1){
                // alert("登录成功");
                window.location.href="index.html"
            }else{
                alert(resData.msg)
            }
            console.log(resData);
          }); 
    }
   
})

